﻿
/* ==============================================================================
*
*   Copyright (c) 2010, Pierre Favier
*   All rights reserved.
*
*   NTasking is free software: you can redistribute it and/or modify it
*   under the terms of the GNU General Public License as published by the
*   Free Software Foundation.
*
*   Redistribution and use in source and binary forms, with or without
*   modification, are permitted provided that the following conditions
*   are met:
*
*   -   Redistributions of source code must retain the above copyright notice,
*       this list of conditions and the following disclaimer.
*
*   -   Redistributions in binary form must reproduce the above
*       copyright notice, this list of conditions and the following
*       disclaimer in the documentation and/or other materials
*       provided with the distribution.
*
*   THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
*   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
*   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
*   DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
*   BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
*   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
*   TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
*   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
*   ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
*   TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
*   THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
*   SUCH DAMAGE.
*
* ============================================================================== */

// This code has been generated by the T4 engine. DO NOT EDIT otherwise your changes
// will be overwritten at next generation

using System;

namespace NTasking
{

    /// <summary>
    /// Define extension methods which allow to implement the fluent syntax for writing a selective accept
    /// </summary>
    public static partial class SA
    {
        
        #region For entry/entry family with 0 parameters

        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T>(this IBeforeAccept<T> iba, Action entry, Action Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptEntry<T, Action>(((Base)iba).Select, entry, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, RetT>(this IBeforeAccept<T> iba, Func<RetT> entry, Func<RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptEntry<T, Func<RetT>>(((Base)iba).Select, entry, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T">The entry family index type</typeparam>
        /// <typeparam name="IndexT"></typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry family member.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT>(this IBeforeAccept<T> iba, Action entry, Action<IndexT> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptMember<T, IndexT, Action, Action<IndexT>>(((Base)iba).Select, entry, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T">The entry family index type</typeparam>
        /// <typeparam name="IndexT"></typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry family member.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, RetT>(this IBeforeAccept<T> iba, Func<RetT> entry, Func<IndexT, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptMember<T, IndexT, Func<RetT>, Func<IndexT, RetT>>(((Base)iba).Select, entry, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT>(this IBeforeAccept<T> iba, ActionFamily<IndexT> family, Action<IndexT> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Action<IndexT>>(((Base)iba).Select, family, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, RetT>(this IBeforeAccept<T> iba, FuncFamily<IndexT, RetT> family, Func<IndexT, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Func<IndexT, RetT>>(((Base)iba).Select, family, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT>(this IBeforeAccept<T, IndexT> iba, ActionFamily<IndexT> family, Action<IndexT> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Action<IndexT>>(((Base)iba).Select, family, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, RetT>(this IBeforeAccept<T, IndexT> iba, FuncFamily<IndexT, RetT> family, Func<IndexT, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Func<IndexT, RetT>>(((Base)iba).Select, family, Do, true, Exception);
        }

        #endregion


        #region For entry/entry family with 1 parameters

        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, P1T>(this IBeforeAccept<T> iba, Action<P1T> entry, Action<P1T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptEntry<T, Action<P1T>>(((Base)iba).Select, entry, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, P1T, RetT>(this IBeforeAccept<T> iba, Func<P1T, RetT> entry, Func<P1T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptEntry<T, Func<P1T, RetT>>(((Base)iba).Select, entry, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T">The entry family index type</typeparam>
        /// <typeparam name="IndexT"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry family member.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T>(this IBeforeAccept<T> iba, Action<P1T> entry, Action<IndexT, P1T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptMember<T, IndexT, Action<P1T>, Action<IndexT, P1T>>(((Base)iba).Select, entry, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T">The entry family index type</typeparam>
        /// <typeparam name="IndexT"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry family member.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, RetT>(this IBeforeAccept<T> iba, Func<P1T, RetT> entry, Func<IndexT, P1T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptMember<T, IndexT, Func<P1T, RetT>, Func<IndexT, P1T, RetT>>(((Base)iba).Select, entry, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T>(this IBeforeAccept<T> iba, ActionFamily<IndexT, P1T> family, Action<IndexT, P1T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Action<IndexT, P1T>>(((Base)iba).Select, family, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, RetT>(this IBeforeAccept<T> iba, FuncFamily<IndexT, P1T, RetT> family, Func<IndexT, P1T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Func<IndexT, P1T, RetT>>(((Base)iba).Select, family, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T>(this IBeforeAccept<T, IndexT> iba, ActionFamily<IndexT, P1T> family, Action<IndexT, P1T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Action<IndexT, P1T>>(((Base)iba).Select, family, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, RetT>(this IBeforeAccept<T, IndexT> iba, FuncFamily<IndexT, P1T, RetT> family, Func<IndexT, P1T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Func<IndexT, P1T, RetT>>(((Base)iba).Select, family, Do, true, Exception);
        }

        #endregion


        #region For entry/entry family with 2 parameters

        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, P1T, P2T>(this IBeforeAccept<T> iba, Action<P1T, P2T> entry, Action<P1T, P2T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptEntry<T, Action<P1T, P2T>>(((Base)iba).Select, entry, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, P1T, P2T, RetT>(this IBeforeAccept<T> iba, Func<P1T, P2T, RetT> entry, Func<P1T, P2T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptEntry<T, Func<P1T, P2T, RetT>>(((Base)iba).Select, entry, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T">The entry family index type</typeparam>
        /// <typeparam name="IndexT"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry family member.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T>(this IBeforeAccept<T> iba, Action<P1T, P2T> entry, Action<IndexT, P1T, P2T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptMember<T, IndexT, Action<P1T, P2T>, Action<IndexT, P1T, P2T>>(((Base)iba).Select, entry, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T">The entry family index type</typeparam>
        /// <typeparam name="IndexT"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry family member.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, RetT>(this IBeforeAccept<T> iba, Func<P1T, P2T, RetT> entry, Func<IndexT, P1T, P2T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptMember<T, IndexT, Func<P1T, P2T, RetT>, Func<IndexT, P1T, P2T, RetT>>(((Base)iba).Select, entry, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T>(this IBeforeAccept<T> iba, ActionFamily<IndexT, P1T, P2T> family, Action<IndexT, P1T, P2T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Action<IndexT, P1T, P2T>>(((Base)iba).Select, family, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, RetT>(this IBeforeAccept<T> iba, FuncFamily<IndexT, P1T, P2T, RetT> family, Func<IndexT, P1T, P2T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Func<IndexT, P1T, P2T, RetT>>(((Base)iba).Select, family, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T>(this IBeforeAccept<T, IndexT> iba, ActionFamily<IndexT, P1T, P2T> family, Action<IndexT, P1T, P2T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Action<IndexT, P1T, P2T>>(((Base)iba).Select, family, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, RetT>(this IBeforeAccept<T, IndexT> iba, FuncFamily<IndexT, P1T, P2T, RetT> family, Func<IndexT, P1T, P2T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Func<IndexT, P1T, P2T, RetT>>(((Base)iba).Select, family, Do, true, Exception);
        }

        #endregion


        #region For entry/entry family with 3 parameters

        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, P1T, P2T, P3T>(this IBeforeAccept<T> iba, Action<P1T, P2T, P3T> entry, Action<P1T, P2T, P3T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptEntry<T, Action<P1T, P2T, P3T>>(((Base)iba).Select, entry, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, P1T, P2T, P3T, RetT>(this IBeforeAccept<T> iba, Func<P1T, P2T, P3T, RetT> entry, Func<P1T, P2T, P3T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptEntry<T, Func<P1T, P2T, P3T, RetT>>(((Base)iba).Select, entry, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T">The entry family index type</typeparam>
        /// <typeparam name="IndexT"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry family member.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, P3T>(this IBeforeAccept<T> iba, Action<P1T, P2T, P3T> entry, Action<IndexT, P1T, P2T, P3T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptMember<T, IndexT, Action<P1T, P2T, P3T>, Action<IndexT, P1T, P2T, P3T>>(((Base)iba).Select, entry, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T">The entry family index type</typeparam>
        /// <typeparam name="IndexT"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry family member.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, P3T, RetT>(this IBeforeAccept<T> iba, Func<P1T, P2T, P3T, RetT> entry, Func<IndexT, P1T, P2T, P3T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptMember<T, IndexT, Func<P1T, P2T, P3T, RetT>, Func<IndexT, P1T, P2T, P3T, RetT>>(((Base)iba).Select, entry, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, P3T>(this IBeforeAccept<T> iba, ActionFamily<IndexT, P1T, P2T, P3T> family, Action<IndexT, P1T, P2T, P3T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Action<IndexT, P1T, P2T, P3T>>(((Base)iba).Select, family, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, P3T, RetT>(this IBeforeAccept<T> iba, FuncFamily<IndexT, P1T, P2T, P3T, RetT> family, Func<IndexT, P1T, P2T, P3T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Func<IndexT, P1T, P2T, P3T, RetT>>(((Base)iba).Select, family, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, P3T>(this IBeforeAccept<T, IndexT> iba, ActionFamily<IndexT, P1T, P2T, P3T> family, Action<IndexT, P1T, P2T, P3T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Action<IndexT, P1T, P2T, P3T>>(((Base)iba).Select, family, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, P3T, RetT>(this IBeforeAccept<T, IndexT> iba, FuncFamily<IndexT, P1T, P2T, P3T, RetT> family, Func<IndexT, P1T, P2T, P3T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Func<IndexT, P1T, P2T, P3T, RetT>>(((Base)iba).Select, family, Do, true, Exception);
        }

        #endregion


        #region For entry/entry family with 4 parameters

        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, P1T, P2T, P3T, P4T>(this IBeforeAccept<T> iba, Action<P1T, P2T, P3T, P4T> entry, Action<P1T, P2T, P3T, P4T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptEntry<T, Action<P1T, P2T, P3T, P4T>>(((Base)iba).Select, entry, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, P1T, P2T, P3T, P4T, RetT>(this IBeforeAccept<T> iba, Func<P1T, P2T, P3T, P4T, RetT> entry, Func<P1T, P2T, P3T, P4T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptEntry<T, Func<P1T, P2T, P3T, P4T, RetT>>(((Base)iba).Select, entry, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T">The entry family index type</typeparam>
        /// <typeparam name="IndexT"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry family member.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, P3T, P4T>(this IBeforeAccept<T> iba, Action<P1T, P2T, P3T, P4T> entry, Action<IndexT, P1T, P2T, P3T, P4T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptMember<T, IndexT, Action<P1T, P2T, P3T, P4T>, Action<IndexT, P1T, P2T, P3T, P4T>>(((Base)iba).Select, entry, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T">The entry family index type</typeparam>
        /// <typeparam name="IndexT"></typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="entry">The accepted entry family member.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, P3T, P4T, RetT>(this IBeforeAccept<T> iba, Func<P1T, P2T, P3T, P4T, RetT> entry, Func<IndexT, P1T, P2T, P3T, P4T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptMember<T, IndexT, Func<P1T, P2T, P3T, P4T, RetT>, Func<IndexT, P1T, P2T, P3T, P4T, RetT>>(((Base)iba).Select, entry, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, P3T, P4T>(this IBeforeAccept<T> iba, ActionFamily<IndexT, P1T, P2T, P3T, P4T> family, Action<IndexT, P1T, P2T, P3T, P4T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Action<IndexT, P1T, P2T, P3T, P4T>>(((Base)iba).Select, family, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, P3T, P4T, RetT>(this IBeforeAccept<T> iba, FuncFamily<IndexT, P1T, P2T, P3T, P4T, RetT> family, Func<IndexT, P1T, P2T, P3T, P4T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Func<IndexT, P1T, P2T, P3T, P4T, RetT>>(((Base)iba).Select, family, Do, true, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, P3T, P4T>(this IBeforeAccept<T, IndexT> iba, ActionFamily<IndexT, P1T, P2T, P3T, P4T> family, Action<IndexT, P1T, P2T, P3T, P4T> Do = null, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Action<IndexT, P1T, P2T, P3T, P4T>>(((Base)iba).Select, family, Do, false, Exception);
        }


        /// <summary>
        /// Add an accept alternative.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="IndexT">The entry family index type</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <typeparam name="RetT">The result type</typeparam>
        /// <param name="iba">The current instance</param>
        /// <param name="family">The accepted entry family.</param>
        /// <param name="Do">The accept body.</param>
        /// <param name="Exception">The accept body's exception handler.</param>
        /// <returns></returns>
        public static T Accept<T, IndexT, P1T, P2T, P3T, P4T, RetT>(this IBeforeAccept<T, IndexT> iba, FuncFamily<IndexT, P1T, P2T, P3T, P4T, RetT> family, Func<IndexT, P1T, P2T, P3T, P4T, RetT> Do, Func<Exception, bool> Exception = null)
            where T : Base, new()
        {
            return AcceptFamily<T, IndexT, Func<IndexT, P1T, P2T, P3T, P4T, RetT>>(((Base)iba).Select, family, Do, true, Exception);
        }

        #endregion

    }

}
